from config.config import HOST
class BasePage:
    """页面基类"""
    def __init__(self, driver):
        """传递driver，url"""
        self.driver = driver
        self.url=f"{HOST}{self.url}"
    def open(self):
        """打开浏览器"""
        self.driver.get(self.url)
    def find_element(self,locator):
        """定位元素"""
        return self.driver.find_element(*locator)
    def send_keys(self,locator,content):
        """输入值"""
        self.find_element(locator).send_keys(content)
    def click(self,locator):
        """点击"""
        self.find_element(locator).click()

